package IO.转换流;

import java.io.*;


public class 转换流 {
    /**
     * 将字节流转化为字符流进行操作
     * 只能读取字符，无法读取 图片等 字节文件
     * @param args
     */
    public static void main(String[] args) throws IOException {
        InputStreamReader isr = new InputStreamReader(new FileInputStream("D:\\IOFile\\test\\copy.txt"));
        OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream("D:/IOFile/copy2.txt"));
        char[] chs = new char[1024];
        int len = -1;
        while((len = isr.read(chs)) != -1){
            osw.write(chs);
            osw.flush();
        }
        osw.close();
        isr.close();
    }
}
